1. Field of the Invention
The present invention relates to a data compression and decompression unit. More specifically, the present invention relates to a data compression and decompression unit and method which can enhance data throughput of a compression section and a decompression section, without enlargement of input and output buffer sizes, by dynamically allocating parts of the input and output buffers in accordance with a data compressibility.
2. Description of the Related Art
In general, image forming apparatus such as printers, print images in a page unit at a high speed. Raw data such as bit map data of one or more pages are continuously stored in the printers, and the printers print the images on the basis of the bit map data.
However, since the amount of the bit map data can be excessively large, a large memory capacity is required, thereby increasing the cost of the printer. In order to prevent the increase in cost, a method has typically been used in which the bit map data transmitted from a terminal and similar devices, is compressed and the compressed bit map data is stored in a memory. The compressed bit map data can then be decompressed and read out from the memory when needed.
In this way, a greater amount of bit map data can be stored in a memory having the same size as the existing memory. In order to perform the compression and decompression of the bit map data, it is necessary to provide buffers for temporarily storing the bit map data before and after receipt by the memory.
FIG. 1 is a block diagram illustrating a conventional data compression and decompression unit, where the conventional data compression and decompression unit comprises a compression section 105, a terminal 100, a memory 120, and a decompression section 115. The compression section 105 comprises an input first-in first-out (FIFO) buffer 101, a compression core 102, a direct memory access (DMA) controller 103 for compression, and an output first-in first-out (FIFO) buffer 104. The decompression section 15 comprises an input first-in first-out (FIFO) buffer 111, a decompression core 113, a direct memory access (DMA) controller 112 for decompression, and an output first-in first-out (FIFO) buffer 114.
A conventional method of compressing and decompressing bit map data will now be described with reference to FIG. 1.
When a user gives a command for printing documents prepared through application programs in the terminal 100, the documents are converted into the bit map data and are stored in the memory 120 through a system bus 130.
The compression core 102 then reads out the bit map data stored in the memory 120, temporarily stores the read-out bit map data in the input FIFO buffer 101, and then reads out and compresses the bit map data from the input FIFO buffer 101. The compressed bit map data is temporarily stored in the output FIFO buffer 104, and then stored in the memory 120. Thereafter, the large amount of bit map data transmitted from the terminal 100 is erased and only the compressed bit map data remains stored in the memory 120, therefore a large amount of data can be stored through such a compression.
The decompression core 113 then reads out the compressed bit map data stored in the memory 120, and temporarily stores the compressed bit map data in the input FIFO buffer 111. The compressed bit map data is decompressed by the decompression core 113, converted into the original bit map data, and is temporarily stored in the output FIFO buffer 114. Thereafter, the bit map data is stored in the memory 120, and then printed through a print engine (not shown).
The compression section 105 and the decompression section 115 include direct memory access (DMA) controllers 103 and 112, respectively, and thus read out data from the memory 120, or store data in the memory 120, by using a direct memory access method. The direct memory access method defines a method in which the data transmission is carried out directly between a memory and input and output units, without using a central processing unit (CPU).
In the conventional data compression and decompression unit, the decompression core must decompress the compressed bit map data in real time so as to print the bit map data corresponding to the maximum output speed of the printer. However, since the size of the input FIFO buffer 111 is restricted, a data throughput which can be processed in real time is restricted, even if the decompression core 113 carries out the decompressing operation at a high speed. Therefore, the maximum output speed of the printer is unavoidably restricted.
If the maximum output speed of the printer is raised excessively, an overrun phenomenon occurs. The overrun phenomenon is a phenomenon in which the printing speed exceeds the decompression speed, and data cannot be supplied to the printer when the printer is ready for printing.
Accordingly, in order to raise the printing speed of the printer through increases in data throughput, the sizes of the input FIFO buffer 111 and the output FIFO buffer 114 must be increased. However, the increase in buffer size results in not only increases in cost, but also increases in chip size for both the compression section 105 and the decompression section 115.
Accordingly, a need exists for a system and method which can enhance a data throughput during compression and decompression of data without increases in the size of input and output buffers.